package tdd.refactor;

import java.util.Iterator;
import java.util.List;

public class FeeMgr implements Chargeable{
	List<Chargeable> ch;
	public FeeMgr(List<Chargeable> ch) {
		this.ch = ch;
	}

	public double chargeByMiles(double miles){
		double fee = 0;		
		Iterator<Chargeable> it = this.ch.iterator();
		while(it.hasNext()) {
			fee += it.next().chargeByMiles(miles);
		}
		return fee;
	}
	

}
